home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / HELLO.ZIP / os2 / JCEASTER.CMD < prev    next >
Encoding:
Text File  |  1996-04-02  |  2.8 KB  |  64 lines

  1. /******************************* REXX *********************************/
  2. /*  This is an external function, written in REXX, that will return   */
  3. /*  the Julian date for Easter of any given year.                     */
  4. /*  Invocation:                                                       */
  5. /*       east_sun = JCEaster(xxxx)                                    */
  6. /*  Where:                                                            */
  7. /*       xxxx = The year in question.  If this is omitted, the        */
  8. /*              current year is assumed.                              */
  9. /*       east_sun = the returned value in the form yyyyddd            */
  10. /**********************************************************************/
  11. Parse Arg year, .
  12. If year = '' Then
  13.    year = Left(Date('S'), 4)
  14.  
  15. /**********************************************************************/
  16. /*  Table to determine the calendar date of the Paschal Full Moon     */
  17. /*  (not necessarily the astronomical full moon)                      */
  18. /**********************************************************************/
  19. easter.0 = 19
  20. easter.1 = '04/14'
  21. easter.2 = '04/03'
  22. easter.3 = '03/23'
  23. easter.4 = '04/11'
  24. easter.5 = '03/31'
  25. easter.6 = '04/18'
  26. easter.7 = '04/08'
  27. easter.8 = '03/28'
  28. easter.9 = '04/16'
  29. easter.10 = '04/05'
  30. easter.11 = '03/25'
  31. easter.12 = '03/13'
  32. easter.13 = '04/02'
  33. easter.14 = '03/22'
  34. easter.15 = '04/10'
  35. easter.16 = '03/30'
  36. easter.17 = '04/17'
  37. easter.18 = '04/07'
  38. easter.19 = '03/27'
  39.  
  40. /**********************************************************************/
  41. /*  Determine the date of the Paschal Full Moon by dividing the year  */
  42. /*  by 19.  The remainder is used as an index into the table defined  */
  43. /*  above.                                                            */
  44. /**********************************************************************/
  45. i = (year // 19) + 1
  46.  
  47. /**********************************************************************/
  48. /*  Convert the resulting calendar date of the Paschal Full Moon      */
  49. /*  into Julian format, which is an easier form with which to         */
  50. /*  perform date calculations.  Determine the day of the week upon    */
  51. /*  which the Paschal Full Moon falls.                                */
  52. /**********************************************************************/
  53. pfm = JCCalJul(easter.i || '/' || year)
  54. day = 8 - JCDoW(pfm)
  55.  
  56. /**********************************************************************/
  57. /*  Easter falls on the first Sunday AFTER the Paschal Full Moon.     */
  58. /*  If the Paschal Full Moon is a Sunday, then Easter is the          */
  59. /*  following Sunday.  Return the extended Julian date for Easter to  */
  60. /*  the invoking program.                                             */
  61. /**********************************************************************/
  62. easter_sunday = pfm + day
  63. Return easter_sunday
  64.